assert(#arg>2,"没有目标文件和源文件和地址")
local file = io.open(arg[1],"rb+");
local file2 = io.open(arg[2],"rb");
local data = file2:read("*a");
local address = tonumber(arg[3]);
file:seek("set",address);
local noswp = false;
for k,v in ipairs(arg)do
    if(v=='-noswp')then
        noswp = true;
    end
end
for k=1,#data,2 do
    local v1 = data:sub(k,k);
    local v2 = data:sub(k+1,k+1);
    if(noswp)then
        local t = v2;
        v2 = v1;
        v1 = t;
    end

    --整数交换
    file:write(v2,v1);
end